package com.jgp.attachment.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * 项目   parent
 * 作者   loufei
 * 时间   2018/5/1
 */
public class MimeUtil {

    public static String extToMime(String ext){
        return mime.get(ext);
    }

    public static final Map<String,String> mime = new HashMap();

    static {
        mime.put("ez","application/andrew-inset");
        mime.put("tsp","application/dsptype");
        mime.put("spl","application/futuresplash");
        mime.put("hta","application/hta");
        mime.put("hqx","application/mac-binhex40");
        mime.put("cpt","application/mac-compactpro");
        mime.put("nb","application/mathematica");
        mime.put("mdb","application/msaccess");
        mime.put("oda","application/oda");
        mime.put("ogg","application/ogg");
        mime.put("pdf","application/pdf");
        mime.put("key","application/pgp-keys");
        mime.put("pgp","application/pgp-signature");
        mime.put("prf","application/pics-rules");
        mime.put("rar","application/rar");
        mime.put("rdf","application/rdf+xml");
        mime.put("rss","application/rss+xml");
        mime.put("zip","application/zip");
        mime.put("apk","application/vnd.android.package-archive");
        mime.put("cdy","application/vnd.cinderella");
        mime.put("stl","application/vnd.ms-pki.stl");
        mime.put("odb","application/vnd.oasis.opendocument.database");
        mime.put("odf","application/vnd.oasis.opendocument.formula");
        mime.put("odg","application/vnd.oasis.opendocument.graphics");
        mime.put("otg","application/vnd.oasis.opendocument.graphics-template");
        mime.put("odi","application/vnd.oasis.opendocument.image");
        mime.put("ods","application/vnd.oasis.opendocument.spreadsheet");
        mime.put("ots","application/vnd.oasis.opendocument.spreadsheet-template");
        mime.put("odt","application/vnd.oasis.opendocument.text");
        mime.put("odm","application/vnd.oasis.opendocument.text-master");
        mime.put("ott","application/vnd.oasis.opendocument.text-template");
        mime.put("oth","application/vnd.oasis.opendocument.text-web");
        mime.put("kml","application/vnd.google-earth.kml+xml");
        mime.put("kmz","application/vnd.google-earth.kmz");
        mime.put("doc","application/msword");
        mime.put("dot","application/msword");
        mime.put("docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document");
        mime.put("dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template");
        mime.put("xls","application/vnd.ms-excel");
        mime.put("xlt","application/vnd.ms-excel");
        mime.put("xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
        mime.put("xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template");
        mime.put("ppt","application/vnd.ms-powerpoint");
        mime.put("pot","application/vnd.ms-powerpoint");
        mime.put("pps","application/vnd.ms-powerpoint");
        mime.put("pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation");
        mime.put("potx","application/vnd.openxmlformats-officedocument.presentationml.template");
        mime.put("ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow");
        mime.put("cod","application/vnd.rim.cod");
        mime.put("mmf","application/vnd.smaf");
        mime.put("sdc","application/vnd.stardivision.calc");
        mime.put("sda","application/vnd.stardivision.draw");
        mime.put("sdd","application/vnd.stardivision.impress");
        mime.put("sdp","application/vnd.stardivision.impress");
        mime.put("smf","application/vnd.stardivision.math");
        mime.put("sdw","application/vnd.stardivision.writer");
        mime.put("vor","application/vnd.stardivision.writer");
        mime.put("sgl","application/vnd.stardivision.writer-global");
        mime.put("sxc","application/vnd.sun.xml.calc");
        mime.put("stc","application/vnd.sun.xml.calc.template");
        mime.put("sxd","application/vnd.sun.xml.draw");
        mime.put("std","application/vnd.sun.xml.draw.template");
        mime.put("sxi","application/vnd.sun.xml.impress");
        mime.put("sti","application/vnd.sun.xml.impress.template");
        mime.put("sxm","application/vnd.sun.xml.math");
        mime.put("sxw","application/vnd.sun.xml.writer");
        mime.put("sxg","application/vnd.sun.xml.writer.global");
        mime.put("stw","application/vnd.sun.xml.writer.template");
        mime.put("vsd","application/vnd.visio");
        mime.put("abw","application/x-abiword");
        mime.put("dmg","application/x-apple-diskimage");
        mime.put("bcpio","application/x-bcpio");
        mime.put("torrent","application/x-bittorrent");
        mime.put("cdf","application/x-cdf");
        mime.put("vcd","application/x-cdlink");
        mime.put("pgn","application/x-chess-pgn");
        mime.put("cpio","application/x-cpio");
        mime.put("deb","application/x-debian-package");
        mime.put("udeb","application/x-debian-package");
        mime.put("dcr","application/x-director");
        mime.put("dir","application/x-director");
        mime.put("dxr","application/x-director");
        mime.put("dms","application/x-dms");
        mime.put("wad","application/x-doom");
        mime.put("dvi","application/x-dvi");
        mime.put("flac","application/x-flac");
        mime.put("pfa","application/x-font");
        mime.put("pfb","application/x-font");
        mime.put("gsf","application/x-font");
        mime.put("pcf","application/x-font");
        mime.put("pcf.z","application/x-font");
        mime.put("mm","application/x-freemind");
        mime.put("spl","application/x-futuresplash");
        mime.put("gnumeric","application/x-gnumeric");
        mime.put("sgf","application/x-go-sgf");
        mime.put("gcf","application/x-graphing-calculator");
        mime.put("gtar","application/x-gtar");
        mime.put("tgz","application/x-gtar");
        mime.put("taz","application/x-gtar");
        mime.put("hdf","application/x-hdf");
        mime.put("ica","application/x-ica");
        mime.put("ins","application/x-internet-signup");
        mime.put("isp","application/x-internet-signup");
        mime.put("iii","application/x-iphone");
        mime.put("iso","application/x-iso9660-image");
        mime.put("jmz","application/x-jmol");
        mime.put("chrt","application/x-kchart");
        mime.put("kil","application/x-killustrator");
        mime.put("skp","application/x-koan");
        mime.put("skd","application/x-koan");
        mime.put("skt","application/x-koan");
        mime.put("skm","application/x-koan");
        mime.put("kpr","application/x-kpresenter");
        mime.put("kpt","application/x-kpresenter");
        mime.put("ksp","application/x-kspread");
        mime.put("kwd","application/x-kword");
        mime.put("kwt","application/x-kword");
        mime.put("latex","application/x-latex");
        mime.put("lha","application/x-lha");
        mime.put("lzh","application/x-lzh");
        mime.put("lzx","application/x-lzx");
        mime.put("frm","application/x-maker");
        mime.put("maker","application/x-maker");
        mime.put("frame","application/x-maker");
        mime.put("fb","application/x-maker");
        mime.put("book","application/x-maker");
        mime.put("fbdoc","application/x-maker");
        mime.put("mif","application/x-mif");
        mime.put("wmd","application/x-ms-wmd");
        mime.put("wmz","application/x-ms-wmz");
        mime.put("msi","application/x-msi");
        mime.put("pac","application/x-ns-proxy-autoconfig");
        mime.put("nwc","application/x-nwc");
        mime.put("o","application/x-object");
        mime.put("oza","application/x-oz-application");
        mime.put("p12","application/x-pkcs12");
        mime.put("p7r","application/x-pkcs7-certreqresp");
        mime.put("crl","application/x-pkcs7-crl");
        mime.put("qtl","application/x-quicktimeplayer");
        mime.put("shar","application/x-shar");
        mime.put("swf","application/x-shockwave-flash");
        mime.put("sit","application/x-stuffit");
        mime.put("sv4cpio","application/x-sv4cpio");
        mime.put("sv4crc","application/x-sv4crc");
        mime.put("tar","application/x-tar");
        mime.put("texinfo","application/x-texinfo");
        mime.put("texi","application/x-texinfo");
        mime.put("t","application/x-troff");
        mime.put("roff","application/x-troff");
        mime.put("man","application/x-troff-man");
        mime.put("ustar","application/x-ustar");
        mime.put("src","application/x-wais-source");
        mime.put("wz","application/x-wingz");
        mime.put("webarchive","application/x-webarchive");
        mime.put("webarchivexml","application/x-webarchive-xml");
        mime.put("crt","application/x-x509-ca-cert");
        mime.put("crt","application/x-x509-user-cert");
        mime.put("xcf","application/x-xcf");
        mime.put("fig","application/x-xfig");
        mime.put("xhtml","application/xhtml+xml");
        mime.put("3gpp","audio/3gpp");
        mime.put("amr","audio/amr");
        mime.put("snd","audio/basic");
        mime.put("mid","audio/midi");
        mime.put("midi","audio/midi");
        mime.put("kar","audio/midi");
        mime.put("xmf","audio/midi");
        mime.put("mxmf","audio/mobile-xmf");
        mime.put("mpga","audio/mpeg");
        mime.put("mpega","audio/mpeg");
        mime.put("mp2","audio/mpeg");
        mime.put("mp3","audio/mpeg");
        mime.put("m4a","audio/mpeg");
        mime.put("m3u","audio/mpegurl");
        mime.put("sid","audio/prs.sid");
        mime.put("aif","audio/x-aiff");
        mime.put("aiff","audio/x-aiff");
        mime.put("aifc","audio/x-aiff");
        mime.put("gsm","audio/x-gsm");
        mime.put("m3u","audio/x-mpegurl");
        mime.put("wma","audio/x-ms-wma");
        mime.put("wax","audio/x-ms-wax");
        mime.put("ra","audio/x-pn-realaudio");
        mime.put("rm","audio/x-pn-realaudio");
        mime.put("ram","audio/x-pn-realaudio");
        mime.put("ra","audio/x-realaudio");
        mime.put("pls","audio/x-scpls");
        mime.put("sd2","audio/x-sd2");
        mime.put("wav","audio/x-wav");
        mime.put("bmp","image/bmp");
        mime.put("qcp","audio/x-qcp");
        mime.put("gif","image/gif");
        mime.put("cur","image/ico");
        mime.put("ico","image/ico");
        mime.put("ief","image/ief");
        mime.put("jpeg","image/jpeg");
        mime.put("jpg","image/jpeg");
        mime.put("jpe","image/jpeg");
        mime.put("pcx","image/pcx");
        mime.put("png","image/png");
        mime.put("svg","image/svg+xml");
        mime.put("svgz","image/svg+xml");
        mime.put("tiff","image/tiff");
        mime.put("tif","image/tiff");
        mime.put("djvu","image/vnd.djvu");
        mime.put("djv","image/vnd.djvu");
        mime.put("wbmp","image/vnd.wap.wbmp");
        mime.put("ras","image/x-cmu-raster");
        mime.put("cdr","image/x-coreldraw");
        mime.put("pat","image/x-coreldrawpattern");
        mime.put("cdt","image/x-coreldrawtemplate");
        mime.put("cpt","image/x-corelphotopaint");
        mime.put("ico","image/x-icon");
        mime.put("art","image/x-jg");
        mime.put("jng","image/x-jng");
        mime.put("bmp","image/x-ms-bmp");
        mime.put("psd","image/x-photoshop");
        mime.put("pnm","image/x-portable-anymap");
        mime.put("pbm","image/x-portable-bitmap");
        mime.put("pgm","image/x-portable-graymap");
        mime.put("ppm","image/x-portable-pixmap");
        mime.put("rgb","image/x-rgb");
        mime.put("xbm","image/x-xbitmap");
        mime.put("xpm","image/x-xpixmap");
        mime.put("xwd","image/x-xwindowdump");
        mime.put("igs","model/iges");
        mime.put("iges","model/iges");
        mime.put("msh","model/mesh");
        mime.put("mesh","model/mesh");
        mime.put("silo","model/mesh");
        mime.put("ics","text/calendar");
        mime.put("icz","text/calendar");
        mime.put("csv","text/comma-separated-values");
        mime.put("css","text/css");
        mime.put("htm","text/html");
        mime.put("html","text/html");
        mime.put("323","text/h323");
        mime.put("uls","text/iuls");
        mime.put("mml","text/mathml");
        mime.put("txt","text/plain");
        mime.put("asc","text/plain");
        mime.put("text","text/plain");
        mime.put("diff","text/plain");
        mime.put("po","text/plain");
        mime.put("rtx","text/richtext");
        mime.put("rtf","text/rtf");
        mime.put("ts","text/texmacs");
        mime.put("phps","text/text");
        mime.put("tsv","text/tab-separated-values");
        mime.put("xml","text/xml");
        mime.put("bib","text/x-bibtex");
        mime.put("boo","text/x-boo");
        mime.put("h++","text/x-c++hdr");
        mime.put("hpp","text/x-c++hdr");
        mime.put("hxx","text/x-c++hdr");
        mime.put("hh","text/x-c++hdr");
        mime.put("c++","text/x-c++src");
        mime.put("cpp","text/x-c++src");
        mime.put("cxx","text/x-c++src");
        mime.put("h","text/x-chdr");
        mime.put("htc","text/x-component");
        mime.put("csh","text/x-csh");
        mime.put("c","text/x-csrc");
        mime.put("d","text/x-dsrc");
        mime.put("hs","text/x-haskell");
        mime.put("java","text/x-java");
        mime.put("lhs","text/x-literate-haskell");
        mime.put("moc","text/x-moc");
        mime.put("p","text/x-pascal");
        mime.put("pas","text/x-pascal");
        mime.put("gcd","text/x-pcs-gcd");
        mime.put("etx","text/x-setext");
        mime.put("tcl","text/x-tcl");
        mime.put("tex","text/x-tex");
        mime.put("ltx","text/x-tex");
        mime.put("sty","text/x-tex");
        mime.put("cls","text/x-tex");
        mime.put("vcs","text/x-vcalendar");
        mime.put("vcf","text/x-vcard");
        mime.put("3gpp","video/3gpp");
        mime.put("3gp","video/3gpp");
        mime.put("3g2","video/3gpp");
        mime.put("dl","video/dl");
        mime.put("dif","video/dv");
        mime.put("dv","video/dv");
        mime.put("fli","video/fli");
        mime.put("m4v","video/m4v");
        mime.put("mpeg","video/mpeg");
        mime.put("mpg","video/mpeg");
        mime.put("mpe","video/mpeg");
        mime.put("mp4","video/mp4");
        mime.put("vob","video/mpeg");
        mime.put("qt","video/quicktime");
        mime.put("mov","video/quicktime");
        mime.put("mxu","video/vnd.mpegurl");
        mime.put("webm","video/webm");
        mime.put("lsf","video/x-la-asf");
        mime.put("lsx","video/x-la-asf");
        mime.put("mng","video/x-mng");
        mime.put("asf","video/x-ms-asf");
        mime.put("asx","video/x-ms-asf");
        mime.put("wm","video/x-ms-wm");
        mime.put("wmv","video/x-ms-wmv");
        mime.put("wmx","video/x-ms-wmx");
        mime.put("wvx","video/x-ms-wvx");
        mime.put("avi","video/x-msvideo");
        mime.put("movie","video/x-sgi-movie");
        mime.put("ice","x-conference/x-cooltalk");
        mime.put("sisx","x-epoc/x-sisx-app");
    }
}
